from enum import Enum
from typing import Optional
from pydantic import BaseModel, Field
import uuid 

class ChatRequest(BaseModel):
    """Request schema for agent chat endpoint."""
    user_input: str = Field(..., description="User's input message")


class CheckRequest(BaseModel):
    """Request schema for agent check endpoint."""
    id: Optional[str] = Field(None, description="问题ID, 后端生成")
    item_id: str = Field(..., description="检查项ID")
    plan_id: str = Field(..., description="评估计划ID")
    compliance_type: str = Field(..., description="Compliance item type")
    title: str = Field(..., description="Title of the item")
    description: str = Field(..., description="Detailed description")
    guide: str = Field(..., description="Handling or mitigation guide")
    inspector: str = Field(..., description="Name of the inspector")
    risk_level: Optional[str] = Field(None, description="Risk level")
    compliance_status: Optional[str] = Field(None, description="Compliance status")

class IssueSeverity(str, Enum):
    """问题严重程度枚举"""
    HIGH = 'high'
    MEDIUM = 'medium'
    LOW = 'low'


class IssueType(str, Enum):
    """问题类型枚举"""
    TYPO = 'typo'                         # 错别字
    SEMANTIC = 'semantic'                 # 语义混乱
    RISK_LEVEL = 'risk-level'             # 风险等级不合理
    COMPLIANCE_STATUS = 'compliance-status'  # 合规状态不合理


class AgentCheckResponse(BaseModel):
    """Base response schema for agent endpoints."""
    id: Optional[str] = Field(None, description="问题ID")
    item_id: Optional[str] = Field(None, description="检查项ID")
    plan_id: Optional[str] = Field(None, description="评估计划ID")
    type: Optional[IssueType] = Field(None, description="问题类型")
    severity: Optional[IssueSeverity] = Field(None, description="严重程度")
    description: Optional[str] = Field(None, description="问题描述")
    suggestion: Optional[str] = Field(None, description="改进建议")
    title: Optional[str] = Field(None, description="对应输入的title属性")
    originalContent: Optional[str] = Field(None, description="对应输入的inspector属性")
    originalDescription: Optional[str] = Field(None, description="对应输入的description属性")
    


class AgentChatResponse(BaseModel):
    """Base response schema for agent endpoints."""
    result: Optional[str] = Field(None, description="Chat result")
    